<?php

namespace app\model\freight;

use think\Model;

/**
 * t_freight_rule
 * @property integer $rule_id 运费规则id(主键)
 * @property integer $freight_id 运费模板id
 * @property string $region 地区编号
 * @property mixed $first 首重
 * @property string $first_fee 首重金额
 * @property mixed $additional 续重
 * @property string $additional_fee 续重金额
 * @property integer $weigh 权重排序
 * @property integer $create_time
 */
class FreightRule extends Model
{
    /**
     * The connection name for the model.
     *
     * @var string|null
     */
    protected $connection = 'mysql';

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 't_freight_rule';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $pk = 'rule_id';

    protected function getCityListAttr($value)
    {
        return $value ? explode(",", $value) : [];
    }

    protected function getProvinceListAttr($value)
    {
        return $value ? explode(",", $value) : [];
    }
}
